import requests from '../common/request'
import config from '../config';

//基础配置 - 获取(color, splashScreen, tabBar)配置
export function getThemeConfig() {
  if (config.tpl === "mall") {
    return requests.get({
      url: '/wx/open/user/config'
    })
  } else {
    return requests.get({
      url: '/uaa/wxapp/base/theme_config',
    })
  }
}

export function getUserPhone(data) {
  return requests.post({
    url: '/wx/user/base/phone',
    data: data
  })
}

export function getQrInfo(data) {
  return requests.get({
    url: '/uaa/wxapp/base/qr',
    data: data
  })
}
export function getWxaMsgTpl(data) {
  return requests.get({
    url: '/wxapp/user/msg/tmpl_ids',
    data: data
  })
}

//页面配置
export function getPageConfig(data) {
	return requests.get({
		url: '/wx/open/user/page?type=' + data.type,
		ignoreError: true
	})
}

//获取协议
export function getProtocol(data) {
	return requests.get({
		url: '/business_admin/cashier/getMemberCardProtocol',
		data
	})
}